import request from "../utils/request";
import Qs from "qs";

/**
 *
 * @param {查询实时数据} params
 * @returns
 */
export function getRealDatas(params) {
    return request({
        url: "/realdata/realDataByHeatSytemIds",
        method: "post",
        params,
        paramsSerializer: (params) => {
            return Qs.stringify(params, { indices: false });
        },
    });
}
/**
 *
 * @param {数据下发单点} params
 * @returns
 */
export function realOneSend(params) {
    return request({
        url: "/jieKong/senDataById",
        method: "post",
        params,
    });
}

/**
 *
 * @param {多点下发}} params
 * @returns
 */
export function realAllSend(params) {
    return request({
        url: "/jieKong/senDataByListId",
        method: "post",
        // params,
        data: JSON.stringify(params),
        headers: {
            "Content-Type": "application/json",
        },
    });
}
/**
 *
 * @param {*查询实时数据不带分页} params
 * @returns
 */
export function getRealDataAll(params) {
    return request({
        url: "/realdata/realDataAllList",
        method: "post",
        params,
    });
}
/**
 *
 * @param {标签查询} params
 * @returns
 */
export function getLabelStandData(params) {
    return request({
        url: "/labelStand/listStandGroup",
        method: "post",
        params,
    });
}

/**
 *
 * @param {查询标签} params
 * @returns
 */
export function getLabelData(params) {
    return request({
        url: "/labelStand/listLabelGroup",
        method: "post",
        params,
    });
}

/**
 *
 * @param {根据标签查询实时数据} params
 * @returns
 */
export function getRealDataAlone(params) {
    return request({
        url: "/realdata/listRealData",
        method: "post",
        params,
        headers: { showLoading: true },
    });
}
/**
 *
 * @param {查询实时数据} params
 * @returns
 */
export function getRealData(params) {
    return request({
        url: "/realdata/listRealData",
        method: "post",
        params,
    });
}

/**
 *
 * @param {添加实时数据} params
 * @returns
 */
export function addRealData(params) {
    return request({
        url: "/realdata/addRealData",
        method: "post",
        params,
    });
}

/**
 *
 * @param {编辑实时数据} params
 * @returns
 */
export function editRealData(params) {
    return request({
        url: "/realdata/updateRealData",
        method: "post",
        params,
    });
}

/**
 *
 * @param {删除实时数据} params
 * @returns
 */
export function delRealData(params) {
    return request({
        url: "/realdata/delRealData",
        method: "post",
        params,
    });
}